#include <stdio.h>
//#define M 3
//#define N 5
int main() {
    int arr[3][4] = {1, 2, 3, 4, 10, 20, 30, 40, 100, 200, 300, 400};
    for (int i = 2; i >= 0; i--) {
        for (int j = 3; j >= 0; j--) {
            printf("a[%d][%d] = %#x\n", i, j, &arr[i][j]);
        }
        printf("----------------\n");
    }

    printf("arr    = %#p arr + 1    = %#x arr + 2    = %#x \n", arr, arr + 1,
           arr + 2);
    printf("arr[0] = %#p arr[0] + 1 = %#x arr[0] + 2 = %#x \n", arr[0],
            arr[0] + 1, arr[0] + 2);

    // 降维 升维
    printf("*arr    = %#p *arr + 1    = %#x *arr + 2    = %#x \n", *arr, *arr + 1,
           *arr + 2);
    printf("&arr[0] = %#p &arr[0] + 1 = %#x &arr[0] + 2 = %#x \n", &arr[0],
            &arr[0] + 1, &arr[0] + 2);

    // a   a[0]
    // 解引用
    // a  ->  *a  ->  a[0]
    // a[0]  ->  &a[0]  -> a

    printf("%d\n", *(*(arr + 2) + 1));
    // A[n]  == *(A + n)
      printf("%d\n", arr[2][1]);

      // 结论
      // printf("%d\n",*(*(a + i) + j));


    //    printf("*arr = % #p *arr + 1 = % #x *arr + 2 = % #x \n ", *arr, *arr +
    //    1,*arr + 2); printf("arr[0] = %#p arr[0] + 1 = % #x arr[0] + 2 = % #x \n
    //    ", arr[0],arr[0] + 1, arr[0] + 2);
    //}
    // printf("%d\n", arr[1][1]);
    // printf("%d\n", *(arr[1] + 1));
    // printf("%d\n", *(*(arr + 1) + 1));
    ////行,列
    //// arr[i] 第 i 行, 首元素的地址 一级指针
    //// arr+i 第 i 行的地址 数组指针
    return 0;
}
